package com.gf.zd.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gf.common.BaseController;
import com.gf.zd.model.Tslb;
import com.gf.zd.service.TslbService;

@Controller
@RequestMapping("/tslb")
public class TslbController extends BaseController {

	private static final Logger LOGGER = LoggerFactory.getLogger(TslbController.class);
	
	@Autowired
	private TslbService tslbService;
	
	@RequestMapping(value="/tslbTree",method=RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> getTslbList(){
		Map<String, Object> map=new HashMap<String, Object>();
		
		try {
			List<Tslb> tslbList=tslbService.getTslbList();
			map.put("success", true);
			map.put("tslbList", tslbList);
		} catch (Exception e) {
			e.printStackTrace();
			LOGGER.error(e.getMessage());
			map.put("success", false);
			map.put("message", "<br>详情："+e.getMessage());
		}
		return map;
	}
}
